<?php
session_start();
if(!isset($_SESSION['uid']))
 	{?>
		<script type="text/javascript">
			window.location="error.php"
		</script>
	<?php
 	}else
 		{
			include_once 'topStaticBar.php';		  		
	?>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script type="text/javascript" src="jscolor/jscolor.js"></script>
	<h1 align="center">Add Basic Information</h1>
	<form name="form" method="post" action="addCarServer.php" enctype="multipart/form-data">
		<table border="0" align="center">
		<tr>
		<td align="right">
			Vehicle Title: 
		</td>
		<td align="left">
			<input type="text" name="title" style="width: 600px">
		</td>
		</tr>

		<tr>
		<td align="right">
			Engine: 
		</td>
		<td align="left">
			<input type="text" name="engine" style="width: 200px">
		</td>
		</tr>		

		<tr>
		<td align="right">
			Model Number: 
		</td>
		<td align="left">
			<input type="text" name="model_number" style="width: 200px">
		</td>
		</tr>
		
		<tr>
		<td align="right">
			VIN#: 
		</td>
		<td align="left">
			<input type="text" name="vin" style="width: 200px">
		</td>
		</tr>				
			<tr>
				<td align="right">
					Condition:
				</td>
			<td align="left">
					<select name="condition">
						<option value="">Select Condition</option>
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (`CONDITION`) from filters where `CONDITION` is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$CONDITION=$db_field["CONDITION"];?>
							<option value="<?php echo $CONDITION?>"><?php echo $CONDITION?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
				
			</tr>
			<tr align="right">
				<td>
					Make:
				</td>
			<td align="left">
					<select name="make">
						<option value="">Select Make</option>
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (MAKE) from filters where MAKE is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$MAKE=$db_field["MAKE"];?>
							<option value="<?php echo $MAKE?>"><?php echo $MAKE?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
			</tr>
			<tr align="right">
				<td>
					Body Style:
				</td>
				<td align="left">
					<select name="body_style">
						<option value="">Select Body Style</option>
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (BODY_STYLE) from filters where BODY_STYLE is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$BODY_STYLE=$db_field["BODY_STYLE"];?>
							<option value="<?php echo $BODY_STYLE?>"><?php echo $BODY_STYLE?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
			</tr>
			<tr align="right">
				<td>
					Start Year:
				</td>
				<td align="left">
					<select name="start_year">
					<option value="">Select Start Year </option>
					<option value="1990">1990</option>
					<option value="1991">1991</option>
					<option value="1992">1992</option>
					<option value="1993">1993</option>
					<option value="1994">1994</option>
					<option value="1995">1995</option>
					<option value="1996">1996</option>
					<option value="1997">1997</option>
					<option value="1998">1998</option>
					<option value="1999">1999</option>
					<option value="2000">2000</option>
					<option value="2001">2001</option>
					<option value="2002">2002</option>
					<option value="2003">2003</option>
					<option value="2004">2004</option>
					<option value="2005">2005</option>
					<option value="2006">2006</option>
					<option value="2007">2007</option>
					<option value="2008">2008</option>
					<option value="2009">2009</option>
					<option value="2010">2010</option>
					<option value="2011">2011</option>
					<option value="2012">2012</option>
					<option value="2013">2013</option>
					<option value="2014">2014</option>
					<option value="2015">2015</option>
					<option value="2016">2016</option>
					<option value="2017">2017</option>
					<option value="2018">2018</option>
					<option value="2019">2019</option>
					<option value="2020">2020</option>					
					</select>
				</td>
			</tr>
			<tr align="right">
				<td>
					End Year:
				</td>
				<td align="left">
					<select name="end_year">
					<option value="">Select End Year </option>
					<option value="1990">1990</option>
					<option value="1991">1991</option>
					<option value="1992">1992</option>
					<option value="1993">1993</option>
					<option value="1994">1994</option>
					<option value="1995">1995</option>
					<option value="1996">1996</option>
					<option value="1997">1997</option>
					<option value="1998">1998</option>
					<option value="1999">1999</option>
					<option value="2000">2000</option>
					<option value="2001">2001</option>
					<option value="2002">2002</option>
					<option value="2003">2003</option>
					<option value="2004">2004</option>
					<option value="2005">2005</option>
					<option value="2006">2006</option>
					<option value="2007">2007</option>
					<option value="2008">2008</option>
					<option value="2009">2009</option>
					<option value="2010">2010</option>
					<option value="2011">2011</option>
					<option value="2012">2012</option>
					<option value="2013">2013</option>
					<option value="2014">2014</option>
					<option value="2015">2015</option>
					<option value="2016">2016</option>
					<option value="2017">2017</option>
					<option value="2018">2018</option>
					<option value="2019">2019</option>
					<option value="2020">2020</option>
					</select>
				</td>
			</tr>

			<tr align="right">
				<td>
					Odometer <span style="color: red">(Only Enter Digits)</span>:
				</td>
				<td align="left">
					<input type="text" name="mileage">
				</td>
			</tr>
			<tr align="right">
				<td>
					Transmission:
				</td>
				<td align="left">
					<select name="transmission">
					<option value="">Select Transmission</option>
						
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (TRANSMISSION) from filters where TRANSMISSION is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$TRANSMISSION=$db_field["TRANSMISSION"];?>
							<option value="<?php echo $TRANSMISSION?>"><?php echo $TRANSMISSION?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
			</tr>	
			<tr align="right">
				<td>
					DriveTrain:
				</td>

				<td align="left">
					<select name="drivetrain">
					<option value="">Select Drivetrain</option>
						
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (DRIVE_TRAIN) from filters where DRIVE_TRAIN is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$DRIVE_TRAIN=$db_field["DRIVE_TRAIN"];?>
							<option value="<?php echo $DRIVE_TRAIN?>"><?php echo $DRIVE_TRAIN?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
			</tr>
			<tr align="right">
				<td>
					Exterior Color:
				</td>
				<td align="left">
					<select name="exterior_color">
					<option value="">Select Exterior Color</option>
						
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (EXTERIOR_COLOR) from filters where EXTERIOR_COLOR is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$EXTERIOR_COLOR=$db_field["EXTERIOR_COLOR"];?>
							<option style="background-color: <?php echo $EXTERIOR_COLOR?>" value="<?php echo $EXTERIOR_COLOR?>"><?php echo $EXTERIOR_COLOR?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
			</tr>			
			<tr align="right">
				<td>
					Interior Color:
				</td>
				<td align="left">
					<select name="interior_color">
					<option value="">Select Interior Color</option>
						
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (INTERIOR_COLOR) from filters where INTERIOR_COLOR is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$INTERIOR_COLOR=$db_field["INTERIOR_COLOR"];?>
							<option style="background-color: <?php echo $INTERIOR_COLOR?>" value="<?php echo $INTERIOR_COLOR?>"><?php echo $INTERIOR_COLOR?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
				</tr>
				
			<tr align="right">
				<td>
					Fuel Type:
				</td>
				<td align="left">
					<select name="fuel_type">
					<option value="">Select Fuel Type</option>
						
				<?php
			 			include_once 'topStaticBar.php';
			 			include_once 'dataBaseConnectivityFile.php';
						$sql_get=mysql_query("select (FUEL_TYPE) from filters where FUEL_TYPE is not NULL");
			 			if (!$sql_get)
			 			{
			    			echo 'Could not run query: '.mysql_error();
						}while($db_field=mysql_fetch_assoc($sql_get))
						{
							$FUEL_TYPE=$db_field["FUEL_TYPE"];?>
							<option value="<?php echo $FUEL_TYPE?>"><?php echo $FUEL_TYPE?></option>
				<?php		}					
				 ?>						
					</select>
				</td>
			</tr>
			<tr align="right">
				<td>
					City Miles/Gallon:
				</td>
				<td align="left">
					<input type="text" name="city_miles">
				</td>
			</tr>
			<tr align="right">
				<td>
					Highway Miles/Gallon:
				</td>
				<td align="left">
					<input type="text" name="highway_miles">
				</td>
			</tr>
			<tr align="right">
				<td>
					Status:
				</td>
				<td align="left">
					<select name="select">
						<option value="">Select Status</option>
						<option value="Sold">Sold</option>
						<option value="For-Sale">For Sale</option>
						<option value="Sale-Pending">Sale Pending</option>
					</select>
				</td>
			</tr>
			<tr align="right">
				<td>
					Price($):
				</td>
				<td align="left">
						<input type="text" name="PRICE">
				</td>
			</tr>			
			<tr align="right">
				<td>
					Contact#:
				</td>
				<td align="left">
					<input type="text" name="contact">
				</td>
			</tr>			
		</table>
		
		<table border="0" align="center">
			<tr align="right">
				<td>
					Car Image:
				</td>
				<td align="left">
					<input type="file" name="image">
				</td>
			</tr>
			<tr align="center">
				<td align="center">
					<input type="submit" name="save_basic_profile" id="send" value="Save Car Info">
				</td>
			</tr>			
		</table>
	</form>	
<?php 
  	    }
 ?>